package com.shumm.controller;


import com.shumm.common.Result;
import com.shumm.po.BtcfRelation;
import com.shumm.service.impl.BtcfRelationServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;

@RestController
@RequestMapping("/btc")
public class BtcfRelationController {
    @Autowired
    private BtcfRelationServiceImpl service;

    @PostMapping("/selectByTbidAndName")
    private Result selectByTbidAndName(@RequestParam String content, @RequestParam String name) throws IOException {
        return service.selectByTbidAndName(content, name);
    }
    @PostMapping("/add")
    private Result add(@RequestBody BtcfRelation btc) throws IOException {
        return service.add(btc);
    }
    @PostMapping("/delete")
    private Result delete(@RequestParam int id) throws IOException {
        return service.deleteById(id);

    }
    @PostMapping("/update")
    private Result update(@RequestBody BtcfRelation btc) throws IOException {
      return service.update(btc);
    }
    @PostMapping("/selectById")
    public Result selectById(@RequestParam int id) throws IOException {
      return service.selectById(id);
    }
    @PostMapping("/selectAll")
    public Result selectAll() throws IOException {
       return service.list();
    }
}
